package com.youdianda.controller;


import com.youdianda.dto.ListAddDataDTO;
import com.youdianda.dto.YddAdvimgDTO;

import com.youdianda.entity.YddAdvimg;
import com.youdianda.entity.YddAdvpos;
import com.youdianda.result.Result;
import com.youdianda.service.IYddAdvimgService;
import com.youdianda.vo.ListDataVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author sdy
 * @since 2023-05-15
 */
@RestController
@RequestMapping("/ydd_advimg")


public class YddAdvimgController {
@Autowired
private IYddAdvimgService iYddAdvimgService;
    /**
     * 查询
     * @param id
     * @return
     */
    @GetMapping("/rowInfo")
    public Result<YddAdvpos> Selectpos(Integer id){

        return iYddAdvimgService.Selectpos(id);
    }


    /**
     * 修改
     * @param yddAdvimg
     * @return
     */
    @PostMapping("/update")
    public Result update(@RequestBody YddAdvimg yddAdvimg){
        iYddAdvimgService.update(yddAdvimg);
        return Result.success();
    }



    /**
     * 分页

     * @return
     */
    @GetMapping("/list")
    public Result listYddAdvimgVO(YddAdvimgDTO dto){


        return iYddAdvimgService.listYddAdvimgVO(dto);
    }


    /**
     * 删除
     * @param id
     * @return
     */
    @GetMapping("/del")
    public Result delete(Integer id){

        iYddAdvimgService.delete(id);

        return Result.success();
    }


    /**
     * 新增
     * @param
     * @return
     */
    @PostMapping("/add")
    public Result getyddvimadd(@RequestBody ListAddDataDTO listAddDataDTO){



        return iYddAdvimgService.getyddvimadd(listAddDataDTO);
    }

}

